Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Programmer's Overview / Part 1 - Getting Started With QuickDraw GX


Chapter 3 - Using QuickDraw GX Objects

This chapter introduces the objects used by QuickDraw GX. As mentioned
in Chapter 1, they fall into three main categories: shape objects, support-
ing objects, and printing objects. Shape objects are the core object; supporting objects allow you to modify and view them; and printing objects allow you
to print them out.

To a large extent, all shapes behave similarly. You build, draw, and print them the same way. And, although their use of styles, inks or transforms may differ from shape to shape, all shapes use supporting objects. Likewise, whether you are printing a curve or a piece of text, printing objects operate in the same way. For this reason, this chapter focuses primarily on the various shape objects. Once you understand how they behave, and how to use them, you understand a major part of QuickDraw GX.

To recap, these are the QuickDraw GX shape objects:

This chapter also covers the supporting objects, listed here:

This chapter concludes with a discussion of the printing objects, listed here:

Shapes and supporting objects are tied together through the use of object references as properties. The definition of shape objects includes references to its style, ink, and transform objects. In turn, inks refer to color objects and transforms refer to viewing objects. Figure 3-1 shows how they interrelate.

Figure 3-1 The shape object and some of the supporting objects

QuickDraw GX provides ways to take maximum advantage of these inter-
relationships. For example, rather than requiring applications to individually define new objects every time they create a new shape object, they can access
a set of default QuickDraw GX shapes that include references to default supporting objects.

Another way QuickDraw GX reflects the interrelationships is by using similar names for similar basic functions and making them operate similarly for many, if not all, objects. For example, GXDisposeShape and GXDisposeStyle work the same way, as do GXCopyToShape and GXCopyToStyle, while GXNewShape and GXNewStyle differ primarily in the property values they need to initialize.

This chapter reflects this by opening with a section, "Objects," that introduces default shapes and default properties, followed by several sections on
the basics of creating, copying, cloning, and disposing of shapes and supporting objects.

Once the shared commonalities are outlined, this chapter distinguishes the ways in which the various objects are not alike. This chapter first examines the shape object and its properties, and then examines the style, ink, and transform objects in turn. The final section of this chapter examines QuickDraw GX printing and the printing-related objects and functions.

The section, "Shapes," begins by focusing on geometric shapes in order to establish a starting point for later discussion of other shape types. Geometric, bitmap, picture, text, glyph, and layout--each shape type is discussed in detail, showing what data structures and functions your application needs to create and manipulate them.

In effect, QuickDraw GX boils down to shapes and their supporting objects. Graphics shapes--geometric, bitmap, and picture shapes, are described fully in the QuickDraw GX Graphics book. Typographic shapes--text, glyph, and layout shapes, are described fully in the QuickDraw GX Typography book. Supporting objects--styles, inks, transforms, and view-related objects, are described fully in the QuickDraw GX Objects book. Printing objects are described fully in the QuickDraw GX Printing book.


Chapter Contents
Objects
Creating and Copying Shapes
Cloning and Disposing of Shapes
Creating and Copying Supporting Objects
Cloning and Disposing of Supporting Objects
Sharing Supporting Objects
Shapes
Geometric Shapes
Creating Geometric Shapes
Drawing Geometric Shapes
Editing Geometric Shape Geometries
Specifying Shape Fill
Converting Between Shape Types
Hit-Testing Geometric Shapes
Bitmap Shapes
Creating Bitmap Structures
Editing and Drawing Bitmap Shapes
Creating Offscreen Bitmaps
Hit-Testing Bitmap Shapes
Picture Shapes
Creating, Editing, and Drawing Picture Shapes
Hit-Testing Picture Shapes
Typographic Shapes
Text Shapes
Glyph Shapes
Layout Shapes
Creating and Drawing Typographic Shapes
Editing Typographic Shapes
Hit-Testing Typographic Shapes
Styles
Geometric Styles
Bitmap and Picture Styles
Typographic and Layout Styles
Inks
Colors
Transfer Modes
Transforms
Clips
Mappings
View-Related Objects
Printing Objects

Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996